package com.framework.entity;

import com.framework.entity.base.BapBaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Type;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.util.UUID;

/**
 * @Description: 用户角色关联表
 * @Author: JamesYao
 * @DateTime: 2024/2/19 16:39
 */

@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "user_role")
public class UserRole extends BapBaseEntity {

    @Comment("用户ID")
    @Type(type = "uuid-char")
    @Column(name = "user_id",nullable = false,length = 128)
    @NotNull(message="用户ID不能为空")
    private UUID userId;

    @Comment("角色ID")
    @Type(type = "uuid-char")
    @Column(name = "role_id",nullable = false,length = 128)
    @NotNull(message="角色ID不能为空")
    private UUID roleId;

}
